﻿<UserControl xmlns:PageBar="clr-namespace:Mengsk.ProxyDelivery.App.UI.PageBar"  x:Class="Mengsk.ProxyDelivery.App.UI.Accounting.SellerTradeUserControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
             d:DesignHeight="300" d:DesignWidth="1200" Loaded="UserControl_Loaded">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <StackPanel Orientation="Horizontal" Grid.Row="0">
            <TextBlock Text="交易类型:" Margin="3" VerticalAlignment="Center"/>
            <ComboBox Name="cbbTypes" Margin="3" VerticalAlignment="Center" Width="100"/>
            <TextBlock Text="卖家编号:" Margin="3" VerticalAlignment="Center"/>
            <TextBox Name="tbSellerId" Margin="3" VerticalAlignment="Center" Width="100"/>
            <TextBlock Text="订单编号:" Margin="3" VerticalAlignment="Center"/>
            <TextBox Name="tbOrderId" Margin="3" VerticalAlignment="Center" Width="100"/>
            <TextBlock Text="外部编号:" Margin="3" VerticalAlignment="Center"/>
            <TextBox Name="tbExternId" Margin="3" VerticalAlignment="Center" Width="100"/>
            <TextBlock Text="创建时间:" Margin="3" VerticalAlignment="Center"/>
            <xctk:DateTimePicker Name="dpStart" Margin="3" VerticalAlignment="Center" Width="140"/>
            <TextBlock Text="到:" Margin="3" VerticalAlignment="Center"/>
            <xctk:DateTimePicker Name="dpEnd" Margin="3" VerticalAlignment="Center" Width="140"/>
            <Button Name="btnQuery" Content="查询" Margin="3" VerticalAlignment="Center" Width="60" Click="btnQuery_Click"/>
        </StackPanel>
        
        <DataGrid Grid.Row="1" Name="dgvItems" GridLinesVisibility="All" AutoGenerateColumns="False" IsReadOnly="True" CanUserAddRows="False" CanUserDeleteRows="False" CanUserReorderColumns="False" CanUserResizeRows="False">
            <DataGrid.Columns>
                <DataGridTextColumn Header="交易编号" Binding="{Binding Id}"/>
                <DataGridTextColumn Header="卖家编号" Binding="{Binding SellerId}"/>
                <DataGridTextColumn Header="交易类型" Binding="{Binding Type,Converter={StaticResource descriptionConverter}}"/>
                <DataGridTextColumn Header="订单编号" Binding="{Binding OrderId }"/>
                <DataGridTextColumn Header="外部编号" Binding="{Binding ExternId}"/>
                <DataGridTextColumn Header="交易金额" Binding="{Binding Money,StringFormat=F2}"/>
                <DataGridTextColumn Header="之前金额" Binding="{Binding PreSellerMoney,StringFormat=F2}"/>
                <DataGridTextColumn Header="之后金额" Binding="{Binding CurrentSellerMoney,StringFormat=F2}"/>
                <DataGridTextColumn Header="创建时间" Binding="{Binding CreateTime,Converter={StaticResource datetimeConverter}}"/>
                <DataGridTextColumn Header="创建人员" Binding="{Binding CreateOperator}"/>
                <DataGridTextColumn Header="交易描述" Binding="{Binding Comment}"/>
            </DataGrid.Columns>
        </DataGrid>
        
        <PageBar:PageBarUserControl Grid.Row="2" x:Name="pbBar" PageSize="200" PageChanging="pbBar_PageChanging" />
    </Grid>
</UserControl>
